<template>
  <div>
    <el-button @click="RouteByPath">使用path跳转到Home页面</el-button>
    <el-button @click="RouteByName">使用name跳转到Home页面</el-button>
    <router-link to="/firstPage">第一页</router-link>
    <el-button @click="RoutePath">第一页</el-button>
    <router-link to="/secondPage">第二页</router-link>
    <el-button @click="RouteName">第二页</el-button>
    <router-link to="/testSix/thirdPage">第三页</router-link>
    <el-button @click="goToAbout">about页</el-button>
    <div style="width: 300px; height: 500px; background-color: #907715">
      xxxx
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
/**
 * 页面核心数据结构体说明文档
 *
 *
 */
// import New from './components/New.vue';
export default {
  name: "TestSix",
  components: {
    // New,Old,
  },
  props: {
    sampleP: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {
      sampleD: "value",
    };
  },
  computed: {
    // sampleC() {
    //     return this.sampleD+'--';
    // }
  },
  created() {},
  mounted() {},
  methods: {
    sampleM() {},
    RouteByPath() {
      // this.$router.push("/home");
      this.$router.push({
        path: "/home",
      });
    },
    RouteByName() {
      this.$router.push({
        name: "home",
      });
    },
    RoutePath() {
      this.$router.push({
        path: "/firstPage",
        query: {
          username: "zhangsan",
          password: "lisi",
        },
      });
    },
    RouteName() {
      this.$router.push({
        name: "secondPage",
        params: {
          username: "zhangsan",
          password: "lisi",
        },
      });
    },
    goToAbout() {
      this.$router.push({
        path: "/about/abc/def",
        query: {
          username: "zhangsan",
          password: "lisi",
        },
      });
    },
  },
  watch: {
    // sampleC(newValue, oldValue) {
    //
    // }
  },
};
</script>

<!--<style scoped>-->
<style lang="scss" scoped></style>
